<route lang="json5">
{
  style: {
    navigationBarTitleText: '奈雪乐园',
  },
}
</route>
<script setup lang="ts">
import { ref } from 'vue'
onShow(() => {
  let value = uni.getStorageSync('token')
  if (!value) {
    uni.navigateTo({
      url: '/pages/login/login',
    })
  }
})
interface List {
  id: number
  name: string
  age: number
}
interface Data {
  id: number
  name: string
  img: string
}

let list: List[] = ref([
  {
    id: 0,
    name: '奈雪卷',
    age: 6,
  },
  {
    id: 1,
    name: '积分商城',
    age: 413,
  },
  {
    id: 2,
    name: '余额',
    age: 0,
  },
  {
    id: 3,
    name: '礼品卡',
    age: 0,
  },
])

let data: Data[] = [
  {
    id: 0,
    name: '签到积分',
    img: '/static/img/4.png',
  },
  {
    id: 1,
    name: '签到积分',
    img: '/static/img/5.png',
  },
  {
    id: 2,
    name: '签到积分',
    img: '/static/img/6.png',
  },
  {
    id: 3,
    name: '签到积分',
    img: '/static/img/7.png',
  },
  {
    id: 4,
    name: '签到积分',
    img: '/static/img/8.png',
  },
  {
    id: 5,
    name: '签到积分',
    img: '/static/img/9.png',
  },
  {
    id: 6,
    name: '签到积分',
    img: '/static/img/10.png',
  },
  {
    id: 7,
    name: '签到积分',
    img: '/static/img/11.png',
  },
]

let tiao = () => {
  console.log('1111')
  uni.navigateTo({
    url: '/pages/Information/Information',
  })
}

let tiaozhuan = (id: number) => {
  console.log(id)
  if (id == '1') {
    uni.navigateTo({
      url: '/pages/mine/child/shopping/shopping?id=' + id,
    })
  } else if (id == '2') {
    uni.navigateTo({
      url: '/pages/mine/child/balance/balance?id=' + id,
    })
  } else if (id == '3') {
    uni.navigateTo({
      url: '/pages/mine/child/giftcard/giftcard?id=' + id,
    })
  } else if (id == '0') {
    uni.navigateTo({
      url: '/pages/mine/child/cardroll/cardroll?id=' + id,
    })
  }
}
</script>
<template>
  <view class="page-body">
    <view class="imgs">
      <img src="../../static/img/1.jpeg" alt="" class="imhesee" />
    </view>
    <view class="imgss"></view>
    <view class="ding">
      <view class="ding1">
        <view class="yi">
          <img src="../../static/img/2.jpeg" alt="" class="im" />
          <view @click="tiao" class="yhxx">
            <view>tinypuppet ></view>
            <view>当前成长值410/500</view>
          </view>
          <view class="hyqy">会员权益</view>
        </view>
        <view class="lists">
          <view v-for="item in list" :key="item.id" class="lis" @click="tiaozhuan(item.id)">
            <view>{{ item.age }}</view>
            <view>{{ item.name }}</view>
          </view>
        </view>
      </view>
      <view class="ding2">
        <img src="../../static/img/3.png" alt="" class="aaaa" />
      </view>
    </view>
    <view class="shan">
      <view class="h2">我的服务</view>
      <view class="san1">
        <view v-for="item in data" :key="item.id">
          <img :src="item.img" alt="" class="mg" />
          <view>{{ item.name }}</view>
        </view>
      </view>
    </view>
    <view class="si">会员卡适合用于奈雪的茶和奈雪酒屋指定范围</view>
  </view>
</template>
<style scoped>
@import './index.css';
</style>
